ES6 新功能


Posted by Rich on 2021-04-25

let name = rich
console.log(`hello ${name}`)
//output: hello rich
var  obj = {
    a:1,
    b:2
}
var obj2 = {
    ...obj,   ///destructuring
    c: 3
}
var {a, ...rest} = obj2 //rest parameters
console.log(rest)
//output:{b: 2, c: 3}









Related Posts

[Power BI] 讀書會 #6 Power BI建立資料連結

[Power BI] 讀書會 #6 Power BI建立資料連結

Web開發學習筆記02 — 等號比較運算子(Equality operators) “==” vs. “===”

Web開發學習筆記02 — 等號比較運算子(Equality operators) “==” vs. “===”

體驗最新的 JS 語法:Babel

體驗最新的 JS 語法:Babel


Comments